<template>
	<view class="center">
		<view class="center_top" :style="{backgroundImage: imageCSSTop}">
			<view class="mask"></view>
		</view>
		<view class="center_box_bg">
			<view class="profily">
				<view class="base">
					<view class="profily_header" :style="{backgroundImage: imageCSS}">
					</view>
					<text>{{nickName}}</text>
				</view>
			</view>
			<view class="baiban">

			</view>
			<view class="center_menu">
				<view class="menu_item" hover-class="menu_item_hover" v-for="item in menus" @click="goto(item.to)">
					<image :src="item.icon" mode="aspectFill"></image>
					<text>{{item.name}}</text>
				</view>
				
					<button open-type="contact" >111</button>
			
				
				<view class="menu_item" hover-class="menu_item_hover" >
					<image src="http://1.14.247.152:9797/images/18136客服.png" mode="aspectFill"></image>
					<text>联系客服</text>
					
				</view>
				<navigator target="miniProgram" open-type="navigate" app-id="wx07ba00d351fa34c4" path="pages/course/course" extra-data="" version="release" class='nav'></navigator>
				<view class="menu_item" hover-class="menu_item_hover" >
					<image src="http://1.14.247.152:9797/images/18465课程表.png"></image>
					<text>仲园课程表</text>
				</view>
				
			</view>
		</view>
		<view class="textcss">
		<p>版权所有 © 2022 20级 陈铜川 邓景涛 郑灿杰 李洁容</p>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				nickName: '',
				avatarUrl: '',
				menus: [
					// {
					// 	name: '绑定微信号',
					// 	icon: '../../static/fumou-center-template/6.png',
					// 	key: 1,
					// 	to: '../mine/wechatNumber/wechatNumber'
					// },
					{
						name: '修改校区',
						icon: 'http://1.14.247.152:9797/images/12115学校.png',
						key: 1,
						to: '../mine/bindArea/bindArea'
					},
					{
						name: '我的发布',
						icon: '../../static/fumou-center-template/7.png',
						key: 2,
						to: '../mine/mypublished/mypublished'
					}
					// {
					// 	name: '分享小程序',
					// 	icon: '../../static/fumou-center-template/7.png',
					// 	key: 4,
					// 	to: '../mine/mypublished/mypublished'
					// },
					// {
					// 	name: '我的选购',
					// 	icon: '../../static/fumou-center-template/8.png',
					// 	key: 3,
					// 	to: '../mine/mypurse/mypurse'
					// }
				]
			};
		},
		computed:{
			imageCSS(){
				return "url("+this.avatarUrl+")"
			},
			imageCSSTop(){
				return "url("+this.avatarUrl+")"
			}
		},
		onLoad() {
			
		},
		onShow() {
			let vm = this
			// console.log('!vm.avatarUrl::::',!vm.avatarUrl,vm.avatarUrl)
			// console.log('vm.avatarUrl',vm.avatarUrl=='')
			// if(vm.avatarUrl){
			// 	getApp().globalData.avatarUrl= "http://1.14.247.152:9797/images/18475header.jpg"
			// }
			// if(vm.nickName==null){
			// 	getApp().globalData.nickName=''
			// }
			vm.nickName  = getApp().globalData.nickName
			vm.avatarUrl = getApp().globalData.avatarUrl
			console.log(vm.avatarUrl+"哈哈哈哈")
		},
		methods: {
			goto(to){
				uni.navigateTo({
					url: to
				})
			}
		}
	}
</script>

<style lang="scss">
	// page {
	// 	height: 100%;
	// }

	.profily,
	.profily_header {
		border-radius: 8px;
	}

	.center {
		height: 100vh;
		position: relative;

		&_top {
			height: 18%;
			//background: url('../../static/fumou-center-template/header.jpg') no-repeat 0% 50%;
			background-size: 100%;
			background-repeat:no-repeat;
			background-position: 0% 40%;
			.mask {
				background: rgba(0, 0, 0, .4);
				height: 100%;
			}
		}

		&_box_bg {
			background: #F9F9F9;
			position: relative;

			.profily {
				position: absolute;
				width: 90%;
				// border:1px solid #F7F7F7;
				margin: 0 auto;
				top: -100upx;
				left: 5%;
				background: #FEFEFE;
				padding: 35upx;
				box-sizing: border-box;
				box-shadow: 0px 2px 5px #EDEDED;
			}
		}
	}

	.base {
		display: flex;
		align-items: center;
		border-bottom: 2px solid #F6F6F6;
		padding-bottom: 35upx;
		position: relative;
		.profily_header {
			height: 120rpx;
			width: 120rpx;
			//background-image: url('../../static/fumou-center-template/header.jpg');
			background-size: 100%;
		}

		text {
			margin-left: 20px;
			font-size: 30upx;
		}
		
		image{
			position: absolute;
			height: 40upx;
			width: 40upx;
			right: 0px;
			top:0px;
		}
	}

	.order_status {
		display: flex;
		justify-content: space-between;
		margin-top: 35upx;

		.status {
			width: 140upx;
			font-size: 24upx;
			text-align: center;
			letter-spacing: .5px;
			display: flex;
			flex-direction: column;
			.icon {
				width: 50upx;
				height: 50upx;
				margin: 0 auto;
				margin-bottom: 5px;
				
			}
		}
	}

	.baiban {
		background: #FEFEFE;
		height: 100rpx;
	}

	.center_menu {
		width: 100%;
		display: inline-block;
		position: relative;
		button{
			width: 100%;
			height: 106rpx;
			position: absolute;
			top: 217rpx;
			opacity: 0;
			z-index: 1;
		}
		navigator{
			width: 100%;
			height: 106rpx;
			position: absolute;
			top: 325rpx;
			opacity: 0;
			background-color: pink;
			z-index: 1;
		}
		.menu_item {
			font-size: 28upx;
			letter-spacing: 1px;
			padding: 14px 5%;
			background: #FEFEFE;
			overflow: hidden;
			box-sizing: border-box;
			display: flex;
			align-items: center;
			position: relative;
			border-bottom: 1px solid #EFEFEF;

			// &:hover {
			// 	background: #F6F6F6 !important;
			// }

			&::after {
				content: '';
				width: 30upx;
				height: 30upx;
				position: absolute;
				right: 5%;
				background: url('../../static/fumou-center-template/right.png') no-repeat;
				background-size: 100%;
			}

			text:nth-of-type(1) {
				margin-left: 10px;
			}

			image {
				width: 40upx;
				height: 40upx;
			}

		}
		.menu_item_hover{
				background: #F6F6F6 !important;
		}
	}
	.textcss{
		position: absolute;
		top: 96vh;
		left: 10vw;
		/* text-align: center; */
		color: #828284;
		font-size: 26rpx;
			
	}
</style>
